<#include "../base.ftl"/>
<#macro cssfile>
</#macro>

<#macro scriptfile>
</#macro>

<#macro breadcrumb>
	<ul class="breadcrumb">
	<#include "../index-menu.ftl"/>
	<li class="active">作业信息列表</li>
	</ul>
</#macro>

<#macro title>
广大物流云平台
</#macro>
<#macro jsscript>
$(function(){
    $("#gridTable").jqGrid({
			//字典的url
	        dictUrl : 'optionList!options.action',
	        //字典的key
	        dictCode: ["HANDLING_FLAG"],
            //list表格数据获取地址
            url:'${request.contextPath}/list/mainConsole/tsmJobSchedulingDtl/list.html',
            //list表格编辑地址
            editurl :'${request.contextPath}/operator/tsm/TsmJobSchedulingDtl/operator.html',
            datatype: "json",
            mtype:"POST",
            height: 400,
            colNames:[
                      '作业明细编号',
                      '作业编号',
                      '客户号',
                      '单号',
                      '柜号',
                      '柜型',
                      '封号',
                      '目的地',
                      '卸货地',
                      '装卸标志',
                      '状态',
                      '创建人',
                      '创建日期',
                      '最后修改人',
                      '最后修改时间'
                      ],
            colModel:[              
                {name:'jobDtlId',jsonmap:'JOB_DTL_ID',index:'JOB_DTL_ID',editable:false,hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'jobId',jsonmap:'JOB_ID',index:'JOB_ID',editable:false,hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'customerId',jsonmap:'CUSTOMER_ID',index:'CUSTOMER_ID',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'orderNo',jsonmap:'ORDER_NO',index:'ORDER_NO',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'containerNo',jsonmap:'CONTAINER_NO',index:'CONTAINER_NO',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'containerType',jsonmap:'CONTAINER_TYPE',index:'CONTAINER_TYPE',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'sealNo',jsonmap:'SEAL_NO',index:'SEAL_NO',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'destinationPort',jsonmap:'DESTINATION_PORT',index:'DESTINATION_PORT',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'dischargePort',jsonmap:'DISCHARGE_PORT',index:'DISCHARGE_PORT',align:'center',searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'handlingFlag',jsonmap:'HANDLING_FLAG',index:'HANDLING_FLAG',editable:true,edittype:'select',formatter:'select',editoptions:{dictCode:"HANDLING_FLAG"},align:'center',editrules:{required:true}},
                {name:'status',jsonmap:'STATUS',index:'STATUS',editable:false,hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                
                {name:'createdBy',jsonmap:'CREATED_BY',index:'CREATED_BY',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'createdDate',jsonmap:'CREATED_DATE',index:'CREATED_DATE',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]},
                	formatter : 'date',                
                    formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'},
                    editoptions :  {dataInit: function(element) {
                        $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                    }}       
                },
                {name:'lastUpdBy',jsonmap:'LAST_UPD_BY',index:'LAST_UPD_DATE',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]}},
                {name:'lastUpdDate',jsonmap:'LAST_UPD_DATE',index:'LAST_UPD_DATE',hidden:true,searchoptions : {sopt : [ "eq", "cn" ]},
                	formatter : 'date',                
                    formatoptions : {srcformat : 'Y/m/d',newformat : 'Y-m-d'},
                    editoptions :  {dataInit: function(element) {
                        $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                    }}
                }     
            ],
            sortname:'LAST_UPD_DATE',
            sortorder:'desc',
            viewrecords : true,
            gridview : true,
            autowidth : true,
            rownumbers : true,
            rowNum : 20,
            rowList : [10,20,30],
            jsonReader : {
                page : "page.pageNo",
                total : "page.totalPages",
                records : "page.totalCount",
                root : "page.result",
                repeatitems : false,
                id : 'JOB_DTL_ID'
            },
            
            prmNames : {
                rows : "page.pageSize",
                page : "page.pageNo",
                sort : "page.orderBy",
                order : "page.order"
            },
            pager : "#gridPager",
            caption : "作业信息列表"
        }).navGrid('#gridPager',{
                edit:true,
                edittext:'修改装卸标志',
                add:false, 
                del:false, 
                search: true
        }, {
			//edit
			beforeShowForm: function(form) {},
			reloadAfterSubmit : true,
            closeAfterEdit : true, //修改完毕后关闭
            afterComplete : opertaionPrompt,
            beforeSubmit :validateSumbit
		}, {
			//add
			beforeShowForm: function(form) {},
            reloadAfterSubmit : true,
            closeAfterAdd : true, //新增完毕后关闭
            afterComplete : opertaionPrompt,
            //提交前进行验证
            beforeSubmit :validateSumbit 
		}, {
			//del
            reloadAfterSubmit : true,
            afterComplete : opertaionPrompt
		}, {
            //组合查询
            multipleSearch : true
       });

	    //提交前的验证，检验数据，并加入beanName
	    function validateSumbit(postdata, formid){
	        return [true,''];
	    } 
});
</#macro>
<#macro main>
	<table id="gridTable"></table>
	<div id="gridPager"></div>
</#macro>